package Interfaz;
import org.math.plot.*;

import practica1.FuncionUnaVar;

public class Grafica extends Plot2DPanel{
	private double [] x;
	private double [] y;
	
	public Grafica(){
		super();
		addLegend("SOUTH");
	}
	
	public void anyadirLinea(int n,double[] y,String leyenda){
		double[] x = new double[n];
		for(int i=0;i<n;i++)
			x[i] = i;
		addLinePlot(leyenda,x,y);
	}

	/*
	public void anyadirFuncion(FuncionUnaVar f){
		double min = f.getXmin();
		double i = min;
		double max = f.getXmax();
		double[] x,y;
		if(f instanceof FuncionUnaVar){
			int numValores = ((int)((max-min)/0.01));
			x = new double[numValores];
			y = new double[numValores];
			int j;
			j=0;
			while(j<numValores){
				x[j]=i;
				y[j]=f.calcAptitud(x[j]);
				i+=0.01;
				j++;
			}
			addLinePlot("",x,y);
		}
	}*/
	
}
